import neko.Lib;
import nGui.controls.Text;
import nGui.controls.containers.VBox;
import nGui.controls.Control;
import nGui.Manager;
import nGui.controls.ReturnType;
import nGui.controls.containers.Dialog;

class TextSample
{
	public static function main()
	{
		var bs = new TextSample();
	}
	
	public function new()
	{
		var mng : Manager = new Manager();
		
		var vert : VBox = new VBox();
		var txt1 : Text = new Text( false );
		txt1.readonly = true;
		txt1.width = 150;
		var txt2 : Text = new Text( true );
		txt2.setSize( "150", "50" );
		vert.appendChild( txt1 );
		vert.appendChild( txt2 );
		txt2.onChange = function( char : Int, val : String )
		{
			txt1.value = "Button pressed = " + Std.chr( char );
			return txt2.RTToInt( DEFAULT );
		}
		
		var wind : Dialog = new Dialog( vert );
		wind.title = "Text Sample";
		wind.show();
		mng.loop();
	}	
}